/**
 * Copyright 2009 by Christian Scheid. This file is part of the switch eclipse plugin and is licensed under the GPL
 * version 3. Please refer to the URL http://www.gnu.org/licenses/gpl-3.0.html for details.
 */
package org.digitalsoul.switchplugin.prefs.util;

import org.digitalsoul.switchplugin.actions.ActionType;
import org.digitalsoul.switchplugin.matchers.MatcherType;

public class HelpTexts {

    public static String getHelpText(Enum<?> type) {
        String text = "";

        // ACTIONS
        if (type == ActionType.EXTENSION_REPLACE) {
            text = "Replaces the extension of a file";
        }
        else if (type == ActionType.FILENAME_REPLACE) {
            text = "Uses a regular expression to replace the filename (including file extension)";
        }
        else if (type == ActionType.SUFFIX_APPEND) {
            text = "Appends a suffix to a filename (or removes it if inverse)";
        }
        else if (type == ActionType.PREFIX_APPEND) {
            text = "Appends a prefix to a filename (or removes it if inverse)";
        }
        else if (type == ActionType.LOCATION_REPLACE) {
            text = "Uses a regular expression to replace the location of a file";
        }
        else if (type == ActionType.FILE_SAVE) {
            text = "Stores this particular file under a key to switch to it from any switch item";
        }
        else if (type == ActionType.FILE_LOAD) {
            text = "Switches to a particular file which was saved beforehand";
        }

        // MATCHERS
        else if (type == MatcherType.EXTENSION) {
            text = "Matches a file with this file extension";
        }
        else if (type == MatcherType.SUFFIX) {
            text = "Matches a file with this suffix";
        }
        else if (type == MatcherType.PREFIX) {
            text = "Matches a file with this prefix";
        }
        else if (type == MatcherType.LOCATION) {
            text = "Uses a regular expression to match a file's location";
        }
        else if (type == MatcherType.FILENAME) {
            text = "Uses a regular expression to match a file's name";
        }
        return "Description: " + text;
    }

    public static String getExampleText(Enum<?> type) {
        String text = "";

        // ACTIONS
        if (type == ActionType.EXTENSION_REPLACE) {
            text = "Example: 'groovy' converts 'File.java' to 'File.groovy'";
        }
        else if (type == ActionType.FILENAME_REPLACE) {
            text = "Example: match='\\.java' + replace='.foo' converts 'File.java' to 'File.foo'";
        }
        else if (type == ActionType.LOCATION_REPLACE) {
            text = "Example: match='/model' + replace='/view' converts 'org/model' to 'org/view'";
        }
        else if (type == ActionType.SUFFIX_APPEND) {
            text = "Example: suffix='Test' converts 'File.java' to 'FileTest.java' [inverse: 'FileTest.java' => 'File.java']";
        }
        else if (type == ActionType.PREFIX_APPEND) {
            text = "Example: prefix='Foo' converts 'File.java' to 'FooFile.java' [inverse: 'FooFile.java' => 'File.java']";
        }
        else if (type == ActionType.FILE_SAVE) {
            text = "Example: key='Foo' maps this particular file to the key 'Foo'";
        }
        else if (type == ActionType.FILE_LOAD) {
            text = "Example: key='Foo' will set the switch target to a file which was saved under 'Foo'";
        }

        // MATCHERS
        else if (type == MatcherType.EXTENSION) {
            text = "Example: 'java'  matches e.g 'File.java' in any location";
        }
        else if (type == MatcherType.PREFIX) {
            text = "Example: 'Foo' matches e.g 'FooClass.java' in any location";
        }
        else if (type == MatcherType.SUFFIX) {
            text = "Example: 'Foo' matches e.g 'ClassFoo.java' in any location";
        }
        else if (type == MatcherType.LOCATION) {
            text = "Example: '.*/org/.*'  matches any file in a location like 'src/org/foo'";
        }
        else if (type == MatcherType.FILENAME) {
            text = "Example: '.*TestCase\\.groovy' matches e.g 'MyTestCase.groovy' in any location";
        }
        return text;
    }

    public static String getSwitchItemExplanation() {
        return "- A switch item represent a certain type of file";
    }

    public static String getActionWizardTitle() {
        return "Select an action to change the current file's path/name in order to switch to another file";
    }

    public static String getMatcherWizardTitle() {
        return "Select a matcher to map your switch item to a certain filetype";
    }

    public static String getMatcherHelp() {
        return "- A matcher maps a certain type of file to this switch item";
    }

    public static String getActionsHelp() {
        return "- An action transforms a file's path/name to switch to the next file";
    }

    public static String getSwitchSetsExplanation() {
        return "- A set defines the switching behaviour for a group of related files";
    }
}
